#include <iostream>
#include<time.h>
#include<unistd.h>

#include "Task.hpp"
#include "ThreadPool.hpp"

int main()
{
    // ThreadPool<Task> *d = new ThreadPool<Task>(5);
    srand(time(nullptr));
    ThreadPool<Task>::GetInstance()->Start();
    int len=opers.size();
    while(true)
    {
        int data1=rand()%10+1;
        usleep(1000);
        int data2=rand()%10;
        char op=opers[rand()%len];  
        Task t(data1,data2,op);
        ThreadPool<Task>::GetInstance()->Push(t);
        std::cout << "main thread make task: " << t.GetTask() << std::endl;
        sleep(1);
    }
    return 0;
}